d370ea40403e30c950f733ae114b75c853dd83ac,findbugs/src/java/edu/umd/cs/findbugs/ClassContext.java,ClassContext,getBytecodeSet,#Method#,173
Before Change
BitSet bytecodeSet = bytecodeMap.get(method);
if (bytecodeSet == null) {
final BitSet result = new BitSet();
byte[] instructionList = method.getCode().getCode();
// Create a callback to put the opcodes of the method's
// bytecode instructions into the BitSet.
BytecodeScanner.Callback callback = new BytecodeScanner.Callback() {
public void handleInstruction(int opcode) {
result.set(opcode, true);
}
};
// Scan the method.
BytecodeScanner scanner = new BytecodeScanner();
scanner.scan(instructionList, callback);
// Save the result in the map.
bytecodeSet = result;
After Change
Code code = method.getCode();
if (code != null) {
byte[] instructionList = code.getCode();
// Create a callback to put the opcodes of the method's
// bytecode instructions into the BitSet.
BytecodeScanner.Callback callback = new BytecodeScanner.Callback() {
public void handleInstruction(int opcode) {
result.set(opcode, true);
}
};
// Scan the method.
BytecodeScanner scanner = new BytecodeScanner();
scanner.scan(instructionList, callback);
}
// Save the result in the map.